package Book;

public class BookList {
    private Book[] books = new Book[10];

    //当前书架上书有效个数
    private int usedsize;
    //构造方法存入三本书
    public BookList(){
        books[0] = new Book("三国演义","罗贯中",10,"小说");
        books[1] = new Book("西游记","吴承恩",15,"小说");
        books[2] = new Book("红楼梦","曹雪芹",5,"小说");
        usedsize = 3;
    }

    public Book getBook(int pose){
        if(pose < 0) {
            return null;
        }
        return books[pose];
    }

    public void setBooks(int pose, Book book) {
        books[pose] = book;
    }

    public int getUsedsize() {
        return usedsize;
    }

    public void setUsedsize(int i) {
        this.usedsize = usedsize;
    }
}
